package com.alien.admin.utils.enums;

/**
 * @author zengzhifang
 * @version 1.0.0
 * @ClassName FlowNodeIdEnum.java
 * @Description TODO
 * @Copyright: 2014-现在 厦门神州鹰掌通家园项目组
 * @createTime 2021年10月25日 09:55:00
 */
public enum FlowNodeIdEnum {

    // 开发发起
    DraftByDeveloper(0,"起草节点"),
    SubmitByDeveloper(1,"提交（待主管审核）"),

    // 测试环境
    EnvTestTester(2,"测试环境-测试者确认"),

    // rc环境
    EnvRcDeployer(3,"RC环境-运维确认"),
    EnvRcTester(4,"RC环境-测试人员确认"),
    EnvRcDeveloper(5,"RC环境-开发人员确认"),

    // prod环境
    EnvProdDeployer(6,"PROD环境-运维确认"),
    EnvProdTester(7,"PROD环境-测试人员确认"),
    EnvProdDeveloper(8,"PROD环境-开发人员布确认"),

    Finish(9,"结束");

    private Integer id;
    private String name;

    private FlowNodeIdEnum(Integer id, String name) {
        this.id = id;
        this.name = name;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * 根据id获得某个流程节点
     *
     * @param id
     * @return
     */
    public static FlowNodeIdEnum getById(Integer id){
        FlowNodeIdEnum[] arr = FlowNodeIdEnum.values();
        for(FlowNodeIdEnum flowNodeIdEnum: arr){
            if(flowNodeIdEnum.id.equals(id)){
                return  flowNodeIdEnum;
            }
        }
        return  null;
    }
}
